package com.dx.controller;


import com.dx.result.R;
import com.dx.service.EmailService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import com.dx.domain.EmailDto;

@RestController
@RequiredArgsConstructor
@RequestMapping("/email")
public class EmailController {
    private final EmailService emailService;
    @PostMapping("/send")
    public R<?> sendEmail(@RequestBody EmailDto emailDto, @RequestHeader(value = "sa-token",required = false) String token) {
        emailService.sendSimpleEmail(emailDto);
        return R.success("邮件发送成功");
    }
}
